const Koa=require('koa')

const allRouter=require('./router/router')
const bodyParser=require('koa-bodyparser')
const errorHanlder=require('./error/index')
const {wrapper}=require('./middleWare/wrapper')

const app=new Koa()

app.use(bodyParser())
app.use(allRouter.routes())

app.on('error',errorHanlder)
app.use(wrapper)

module.exports=app